﻿/* ZBRUSH MACRO - Recorded in ZBrush version 4.7
*/
[IButton,???,"BPR then export passes",
[IShowActions,0]
[IConfig,4.7]
[IPress,Render:BPR RenderPass:Render Best Preview]
[IShowActions,0]
//select a save location - file name will be used as the suffix
[VarSet,fpath,[FileNameAsk,"Photoshop(*.jpg)|*.jpg||",RenderPass.jpg ,"Please Save File..."]]
//exit if dialog cancelled
[If,[StrLength,fpath]==0,[Exit]]

//extract the path and name only
[VarSet,fpath,[FileNameExtract,fpath,3]]
//set the file name for the shaded pass export
[FileNameSetNext,[StrMerge,#fpath,"_shaded.jpg"]]
[If,([StrFind,"Width=",[IGetInfo,2219]]>-1),[IPress,2219]]//shaded

//depth export
[FileNameSetNext,[StrMerge,#fpath,"_depth.jpg"]]
[If,([StrFind,"Width=",[IGetInfo,2220]]>-1),[IPress,2220]]//depth

//shadow export
[FileNameSetNext,[StrMerge,#fpath,"_shadow.jpg"]]
[If,([StrFind,"Width=",[IGetInfo,2221]]>-1),[IPress,2221]]//shadow

//AO export
[FileNameSetNext,[StrMerge,#fpath,"_ao.jpg"]]
[If,([StrFind,"Width=",[IGetInfo,2222]]>-1),[IPress,2222]]//AO

//mask export
[FileNameSetNext,[StrMerge,#fpath,"_alpha.jpg"]]
[If,([StrFind,"Width=",[IGetInfo,2223]]>-1),[IPress,2223]]//mask
//Sss export
[FileNameSetNext,[StrMerge,#fpath,"_sss.jpg"]]
[If,([StrFind,"Width=",[IGetInfo,2301]]>-1),[IPress,2301]]//Sss
//Floor export
[FileNameSetNext,[StrMerge,#fpath,"_floor.jpg"]]
[If,([StrFind,"Width=",[IGetInfo,2302]]>-1),[IPress,2302]]//Floor
]//end of macro
